import request from '../request';

// 手机登录
export const loginApi = (data) => {
    return request.get(`/login/cellphone`, {
        params: data
    })
}

// 退出登录
export const logout = () => {
    return request.get('/logout')
}

// 获取用户详情
export const getUserDetail = uid => request.get(`/user/detail?uid=${uid}`, {})

/**
 *  获取用户播放记录
 *  uid 用户 id
 *  type : type=1 时只返回 weekData, type=0 时返回 allData
 */

export const getUserRecord = (uid, type) =>
    request.get(`/user/record?uid=${uid}&type=${type}`, {})

/**
 *  获取用户歌单
 *  uid 用户 id
 */

export const getUserArtist = uid => request.get(`/user/playlist?uid=${uid}`, {})
